home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 029a / mktst100.zip / MAKTST.BAS (.txt) < prev    next >
QuickBASIC Tokenized Source  |  1991-12-27  |  6KB  |  104 lines

  1. numberx
  2. filename
  3. ComLine+
  4. NumArgs
  5. Argsw
  6. MaxArgs
  7. FalseO
  8. start
  9. startingl
  10. ending
  11. StartNum&
  12. EndNum5
  13. FileSizey
  14. BaseName
  15. BaseExt
  16. @    Interpret
  17. argumentb
  18. substr
  19.     SrtartNum
  20. BaseFile
  21. RIGHT
  22.     separator
  23. Validate
  24. ErrCode
  25. Returns!
  26. problem]
  27. problem.
  28. THENStartNum
  29. THENEndNum
  30. CheckLength
  31. StrLen:
  32. NumLen
  33. MaxNum
  34. AddNum
  35. FWENDL
  36. count
  37. Maxcount
  38.     MaxNumber
  39. exitsub
  40.  MAKTST 1.0 Copyright 1991 by Gordon Haff and Bit Masons.
  41.  All rights reserved.9
  42.  Create test files
  43.  Syntax: MAKTST /NUM=number /BEG=StartNum /END=EndNum /SIZE=FileSize /NAME=base.ext
  44.  If /SIZE is not specified, file size = 0 bytess
  45.  If "base" is not specified, the string 'tst' is used.  0 to 7 characters may
  46.    be specified as the base, but larger numbers means fewer files can be created
  47.  if no number and no /BEG and /END is specified, 1 file will be created 
  48.  if number is specified but no /BEG or /END, the specified number of files
  49.    will be created starting with a 0  
  50.  if number is specified and /BEG is specified (but no /END), the specified
  51.    number of files will be created starting with start_num
  52.  if number is specified and /END is specified (but no /BEG), the specified 
  53.    number of files will be created (if possible) ending with end_num
  54.  if number is not specified and /BEG and /END are specified, files will be created
  55.    between those two numbers
  56.  if number is not specified and only /BEG or /END is specified, only one
  57.    file will be createdi
  58. Set default values
  59. Defaults changed by Interpreta
  60. Command line over-specified"
  61. Command line implies negative StartNum
  62. Error Code 3
  63. Filename too long to contain unique file identifiers
  64. Command line under-specified (must provide NUM or BEG & END)
  65. Get what was typed on command line
  66. The number of arguments is N
  67. A$ is an array containing the command-line arguments
  68. MAKTST 1.0  Copyright 1991 by Bit Masons Consulting and Gordon Haff"
  69.             All rights reserved.
  70. Command line syntax is as follows:
  71. MAKTST /NUM=number /BEG=StartNum /END=EndNum /SIZE=FileSize /NAME=file.ext
  72.      You must specify number OR StartNum & EndNum"
  73.      By default 0 byte files are created and
  74.      the file base name is TST with no extension.
  75. Loop through command line parameters and interpret
  76. Fills out global variables
  77. Program aborting
  78.  created
  79. ComLine
  80. Subroutine to get command line and split into argumentse
  81. From QBasic 4.0 reference manual pg. 114
  82. Interpret
  83.  Parse individual switch settings into numbers and a base file name
  84.  No particular validation is done.  If the proper switch is not found, 
  85.  the argument is ignored.  The entry after the switch is converted in,
  86.  an appropriate way, but is not checked.
  87. /BEG=",
  88. /END=",
  89. /NUM=",
  90. /SIZE=,
  91. /NAME=,
  92. Validate
  93.  Does some simple Validation and sets up Begin/End/Number variables
  94.  Returns 0 if no problem.n
  95.  Returns 1 if command line over specifiedg
  96.  Returns 2 if command line results in negative StartNum 
  97.  Returns 5 if insufficient command line information
  98. CheckLength
  99.  Checks Max possible number versus number of files to generate
  100.  Returns ErrCode = 0 if OK and 4 otherwise
  101. In case error code from previous function 
  102.  Get number of spaces for number
  103. Create MaxNum = 10 ^ "leftover spaces"
  104.